package com.woniu.woniu_bx.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 获取当前时间
 *
 * @author sjy
 * @create 2022-08-29 11:18
 */
public class GetCurrentTime {
    /**
     * 时分秒
     *
     * @return
     */
    public static String getCurrentTime() {
        SimpleDateFormat sdf = new SimpleDateFormat();
        sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        return sdf.format(date);
    }
    /**
     * 时分秒毫秒
     *
     * @return
     */
    public static String getCurrentTimeMS() {
        SimpleDateFormat sdf = new SimpleDateFormat();
        sdf.applyPattern("yyyy-MM-dd HH:mm:ss:SSS");
        Date date = new Date();
        return sdf.format(date);
    }
}
